/*  header-comment
/*  file   : /Users/jessica/react-hrm-h5/src/routes/index
/*  author : arida
/*  date   : 2017-6-4 18:26:19
/*  last   : 2017-11-4 16:53:48
*/
import React from "react";
import {
  Router,
  Route,
  hashHistory,
} from "react-router";
import { syncHistoryWithStore } from "react-router-redux";
import configureStore from "../store/configureStore";
import rlog from "../utils/rlog";
const store = configureStore();
const history = syncHistoryWithStore(hashHistory, store);

history.listen(location => {
  let pathname = location.pathname;
  pathname = pathname.replace(/\//g, "_");
  pathname = pathname.toLowerCase();
  rlog(pathname);
});
module.exports = function Routes() {

  return (
    <Router
      history={history}>
      <Route path="/" component={require("../modules/steps/")} />
      <Route path="/entry" component={require("../modules/steps/")} />
      <Route path="/steps" component={require("../modules/steps/")} />

      <Route path="/finish" component={require("../modules/finish")} />
      <Route path="/identify" component={require("../modules/identify")} />
      <Route path="/preview" component={require("../modules/preview")} />
      <Route path="/holiday" component={require("../modules/holiday")} />
      <Route path="/pc" component={require("../modules/welcome/pc")} />
      <Route path="/leaveJob" component={require("../modules/leaveJob/")} />
      <Route
        path="/leaveJobDelete"
        component={require("../modules/leaveJobDelete/")}
      />
      <Route path="/growth" component={require("../modules/growth/")} />
      <Route
        path="/entrantList"
        component={require("../modules/entrant").list}
      />
      <Route path="/confirm" component={require("../modules/confirm/")} />
      <Route
        path="/confirmed"
        component={require("../modules/confirm/confirmed")}
      />
      <Route
        path="/personnelWeekly"
        component={require("../modules/weekly/")}
      />
      
      <Route path="/preJobList" component={require("../modules/preJobList")} />
      <Route path="/onJobList" component={require("../modules/onJobList")} />
      <Route
        path="/pendingLeave"
        component={require("../modules/pendingLeave/")}
      />
      <Route path="/qrCode" component={require("../modules/qrCode/")} />

      <Route
        path="/hrcenter"
        component={require("../modules/hrCenter/index")}
      >
        <Route path="manage" component={require("../modules/hrCenter/statistics/index")} />
        <Route path="employeeAnalyze" component={require("../modules/hrCenter/empAnalyze")} />
        <Route path="selfHelp" component={require("../modules/hrCenter/selfHelp/")}/>
        <Route path="steps" component={require("../modules/steps")}/>
        <Route path="personalCenter" component={require("../modules/growth")} />
        <Route path="preview" component={require("../modules/preview")} />
        <Route path="serviceCenter" component={require("../modules/hrCenter/serviceCenter/")} />
      </Route>

      <Route path="initialize" component={require("../modules/hrCenter/initialize/")}/>

      <Route path="memorialDay" component={require("../modules/memorialDay/")}/>
      
      <Route
        path="/statisticList"
        component={require("../modules/statisticList/")}
      />
      <Route
        path="/noDataPage"
        component={require("../components/noDataPage/")}
      />
      <Route 
        path="/charts"
        component={require("../modules/chart/")}
      />
      <Router 
        path="/empAnalyzeDetail"
        component={require("../modules/empAnalyzeDetail/")}
        />
      <Route path="/todoList" component={require("../modules/todoList/")} />
      <Route path="default" component={require("../modules/notFound/")} />
      <Route path="*" component={require("../modules/notFound/")} />
    </Router>
  );
};
